<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="hello">
  hello world!
</div>
<button id="btn">点击</button>
<script>
    const helloEle = document.getElementById('hello')
    const btnEle = document.getElementById('btn')

    helloEle.addEventListener('cat', function (e) {
        console.log('event:', e)
        console.log("执行cat事件")
    })
    btnEle.addEventListener('click', function () {
        helloEle.dispatchEvent(catEvent)
    })

    const catEvent = new CustomEvent('cat', {
        detail: {
            hascheeseburger: true
        },
        cancelable: false,
        bubbles: false
    })
</script>
</body>
</html>
